import request from '@/utils/axios';
import { attendance } from '@/config/env';

export const page = query => {
  return request({
    url: attendance + '/holiday/page',
    method: 'post',
    data: query,
  });
};

export const find = query => {
  return request({
    url: attendance + '/holiday/find',
    method: 'post',
    data: query,
  });
};

export const findById = id => {
  return request({
    url: attendance + '/holiday/' + id,
    method: 'get',
  });
};

export const save = model => {
  return request({
    url: attendance + '/holiday',
    method: 'post',
    data: model,
  });
};

export const edit = model => {
  return request({
    url: attendance + '/holiday/' + model.id,
    method: 'put',
    data: model,
  });
};

export const del = id => {
  return request({
    url: attendance + '/holiday/' + id,
    method: 'delete',
  });
};

export const batDel = ids => {
  return request({
    url: attendance + '/holiday',
    method: 'delete',
    data: ids,
  });
};

